<?php // Do not delete these lines
	if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
		die ('Please do not load this page directly. Thanks!');

	if (!empty($post->post_password)) { // if there's a password
		if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
			?>

			<p class="nocomments">This post is password protected. Enter the password to view comments.</p>

			<?php
			return;
		}
	}

	/* This variable is for alternating comment background */
	$oddcomment = 'class="alt" ';
?>

<!-- You can start editing here. -->
<?php
if ($comments) :
	$commentdata = array();
	foreach ($comments as $comment) {
		if (get_comment_type() == 'comment') {
			$commentdata['comments'][] = $comment;
		} else {
			$commentdata['trackbacks'][] = $comment;
		}
	}
	$count_comments   = count($commentdata['comments']);
	$count_trackbacks = count($commentdata['trackbacks']);
	echo '<a id="comments" name="comments"></a><!-- skiplink anchor: Kommentare -->';
	if ($count_trackbacks == 0) {
		$count_trackbacks = '';
	} elseif ($count_trackbacks == 1) {
		$count_trackbacks = 'und 1 Trackback/Pingback ';
	} else {
		$count_trackbacks = 'und ' . $count_trackbacks . ' Trackbacks/Pingbacks ';
	}

	if (($count_comments == 0) && ($count_trackbacks != 0)) {
		echo '<h3 class="commentnumber">Kein Kommentar ' . $count_trackbacks . '</h3>';
	} elseif ($count_comments == 1) {
		echo '<h3 class="commentnumber">1 Kommentar ' . $count_trackbacks . '</h3>';
	} else {
		echo '<h3 class="commentnumber">' . $count_comments . ' Kommentare ' . $count_trackbacks . '</h3>';
	} ?>
		<ol class="comments" >
	<?php
	$count = 0; foreach ($comments as $comment) { $count++;
	if($comment->comment_author_email == get_the_author_email() && ($comment->user_id != 0)) {
		$class = "author";
	} else {
		$class = "guest";
	}
?>
			<li id="comment-<?php comment_ID() ?>" class="<?php echo $class; ?>">
				<div class="commentheader"> 
				<?php if (function_exists('get_avatar')):
				$default_img = get_bloginfo('template_directory') . '/images/avatar_default.jpg ';
			endif ?>
					<?php echo get_avatar( $comment, $size='60',$default = $default_img ); ?>
					<h3><a href="<?php echo comment_link(); ?>" title="<?php echo comment_type('Kommentar', 'Trackback', 'Pingback'). '-Permalink';?>" class="commentcount"> <?php echo $count; ?></a>. <?php comment_author_link() ?></h3>
					<p class="commentmeta"><?php comment_type('Kommentar', 'Trackback', 'Pingback'); ?> vom <?php comment_date('j. F Y') ?> um <?php comment_time('H:i') ?> <?php edit_comment_link('&middot; bearbeiten','',''); ?></p>
				 </div>
				<div class="commenttext">
					<?php if ($comment->comment_approved == '0') : ?>
						<p><strong>Dein Kommentar muss noch moderiert werden.</strong></p>
					<?php endif; ?>
					<?php comment_text() ?>
				</div>
			</li>
	<?php /* Changes every other comment to a different class */
	        if ('alt' == $oddcomment) $oddcomment = '';
	        else $oddcomment = 'alt';
	?>

	<?php };?>
			</ol>

<?php else : // this is displayed if there are no comments so far ?>
  	<?php if ('open' == $post->comment_status) : ?>
		<!-- If comments are open, but there are no comments. -->
	 <?php else : // comments are closed ?>
		<!-- If comments are closed. -->
		<?php if(!is_page()): ?>
		<p class="nocomments">Kommentarfunktion ist deaktiviert</p>
		<?php endif; ?>
	<?php endif; ?>
<?php endif; ?>

<?php if ('open' == $post->comment_status) : ?>
	<h3 id="respond">Einen Kommentar schreiben</h3>
	<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
		<p>du mu&szlig;t <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">angemeldet</a> sein, um kommentieren zu k&ouml;nnen.</p>
	<?php else : ?>
		<form id="commentform" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" >
		<?php if ( $user_ID ) : ?>
			<p>Angemeldet als: <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="von diesem Account abmelden">Abmelden &raquo;</a></p>
		<?php else : ?>
			<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" tabindex="1" />
			<label for="author"><small>Name <?php if ($req) echo "(erforderlich)"; ?></small></label></p>
			<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" tabindex="2" />
			<label for="email"><small>eMail <?php if ($req) echo "(erforderlich)"; ?> (wird nicht ver&ouml;ffentlicht)</small></label></p>
			<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" tabindex="3" />
			<label for="url"><small>Webseite</small></label></p>
		<?php endif; ?>
			<div class="quicktags"><script type="text/javascript">displayQuicktags('comment')</script></div>
			<!--<p><small><strong>XHTML:</strong> You can use these tags: <?php //echo allowed_tags(); ?></small></p>-->
			<p><textarea name="comment" id="comment"  rows="10" tabindex="5"></textarea></p>
			<p><input name="submit" type="submit" id="submit" tabindex="6" value="senden" />
			<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></p>
			<?php do_action('comment_form', $post->ID); ?>
		</form>
	<?php endif; // If registration required and not logged in ?>
<?php endif; // if you delete this the sky will fall on your head ?>